package com.demo2.todo.service;

import com.demo2.todo.model.dto.AuthResponse;
import com.demo2.todo.model.dto.AuthRequest;
import com.demo2.todo.model.entity.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author evi
 */
@Service
public interface UserService {
    AuthResponse register(AuthRequest request);
    AuthResponse login(AuthRequest request);
    UserDetails getCurrentUser();

    @Transactional
    User toggleBlacklist(Long userId);

    @Transactional
    User getCurrentUserEntity();

    @Transactional(readOnly = true)
    User getUserById(Long id);

    @Transactional
    void updateUserPassword(Long userId, String newPassword);

    @Transactional
    void disableUser(Long userId);

    @Transactional
    void blockUser(Long userId);

    @Transactional
    void unblockUser(Long userId);

    @Transactional(readOnly = true)
    List<User> getAllUsers();
}